<template>
  <div class="recommend-page">
    <!-- 状态栏 -->

    <!-- 广告卡片 -->
    <div class="ad-card">
      <div class="ad-content">
        <div class="ad-title">宠物医保</div>
        <div class="ad-desc">0元起赔 全病种可赔</div>
        <div class="ad-price">¥278/年</div>
        <van-button class="ad-button" size="small">去投保</van-button>
      </div>
      <div class="corgi-image">
        <!-- 柯基狗SVG图标 -->
        <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
          <circle cx="50" cy="50" r="45" fill="#FFD700" />
          <circle cx="35" cy="40" r="5" fill="#333" />
          <circle cx="65" cy="40" r="5" fill="#333" />
          <path
            d="M40,65 Q50,75 60,65"
            stroke="#333"
            stroke-width="2"
            fill="none" />
          <ellipse cx="30" cy="30" rx="10" ry="8" fill="#FFA500" />
          <ellipse cx="70" cy="30" rx="10" ry="8" fill="#FFA500" />
        </svg>
      </div>
    </div>

    <!-- 功能图标区 -->
    <van-grid class="function-grid" :column-num="3" :border="false">
      <van-grid-item>
        <div class="function-icon">
          <van-icon name="certificate" />
        </div>
        <div class="function-text">办证</div>
      </van-grid-item>
      <van-grid-item>
        <div class="function-icon">
          <van-icon name="shield-o" />
        </div>
        <div class="function-text">保险</div>
      </van-grid-item>
      <van-grid-item>
        <div class="function-icon">
          <van-icon name="chat-o" />
        </div>
        <div class="function-text">问诊</div>
      </van-grid-item>
    </van-grid>

    <!-- 内容卡片 -->
    <div class="content-card">
      <div class="user-info">
        <div class="avatar">
          <svg viewBox="0 0 24 24" fill="white">
            <path
              d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
          </svg>
        </div>
        <span class="username">68宠物</span>
        <span class="post-date">10月13日</span>
      </div>

      <div class="content-title">从溺爱到喂食，这些养狗误区你占了几条？</div>

      <div class="content-image-container">
        <svg
          class="content-image"
          viewBox="0 0 300 200"
          xmlns="http://www.w3.org/2000/svg">
          <rect width="300" height="200" fill="#FFA500" />
          <circle cx="150" cy="80" r="40" fill="#FFD700" />
          <circle cx="140" cy="75" r="3" fill="#333" />
          <circle cx="160" cy="75" r="3" fill="#333" />
          <path
            d="M140,95 Q150,105 160,95"
            stroke="#333"
            stroke-width="2"
            fill="none" />
          <rect x="130" y="115" width="40" height="30" fill="#87CEEB" rx="5" />
          <rect x="120" y="125" width="60" height="5" fill="#556B2F" />
          <text
            x="150"
            y="170"
            text-anchor="middle"
            fill="#000"
            font-size="24"
            font-weight="bold">
            养狗误区
          </text>
          <text
            x="150"
            y="190"
            text-anchor="middle"
            fill="#FFD700"
            font-size="14">
            你中了几条
          </text>
        </svg>
      </div>

      <div class="interaction-bar">
        <div class="interaction-item">
          <van-icon class="interaction-icon" name="good-job-o" />
          <span>2</span>
        </div>
        <div class="interaction-item">
          <van-icon class="interaction-icon" name="chat-o" />
          <span>0</span>
        </div>
      </div>

      <div class="comment-input">说点什么...</div>
    </div>

  </div>
</template>

<script setup>
</script>

<style scoped>
.recommend-page {
  background-color: #f7f8fa;
  min-height: 100vh;
  padding-bottom: 20px;
  padding-top: 46px; /* 原为导航栏留出的空间已移除 */
}

.status-bar {
  height: 20px;
  background-color: #fff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #333;
  border-bottom: 1px solid #eee;
}

.ad-card {
  background: linear-gradient(135deg, #ffb347 0%, #ffcc33 100%);
  border-radius: 12px;
  margin: 15px;
  padding: 15px;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 4px 8px rgba(255, 179, 71, 0.3);
}

.ad-content {
  position: relative;
  z-index: 1;
}

.ad-title {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 5px;
}

.ad-desc {
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.ad-price {
  font-size: 22px;
  font-weight: bold;
  margin: 10px 0;
}

.ad-button {
  background: #fff;
  color: #ff9500;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-weight: bold;
  margin-top: 10px;
}

.corgi-image {
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 100px;
  height: auto;
}

.function-grid {
  margin: 20px 15px;
}

.function-icon {
  width: 50px;
  height: 50px;
  background: #fff6e5;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  color: #ff9500;
  font-size: 24px;
  box-shadow: 0 2px 5px rgba(255, 149, 0, 0.2);
}

.function-text {
  margin-top: 8px;
  font-size: 14px;
  color: #333;
}

.content-card {
  margin: 15px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.user-info {
  display: flex;
  align-items: center;
  padding: 12px 15px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffc0cb;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 10px;
}

.avatar svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.username {
  font-weight: bold;
  font-size: 15px;
}

.post-date {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
}

.content-title {
  padding: 0 15px 12px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.content-image-container {
  width: 100%;
  height: auto;
}

.content-image {
  width: 100%;
  height: auto;
  display: block;
}

.interaction-bar {
  display: flex;
  padding: 10px 15px;
  border-top: 1px solid #eee;
  justify-content: space-around;
}

.interaction-item {
  display: flex;
  align-items: center;
  color: #666;
  font-size: 14px;
}

.interaction-icon {
  margin-right: 5px;
  font-size: 16px;
}

.comment-input {
  background: #f5f5f5;
  border-radius: 18px;
  padding: 8px 15px;
  margin: 10px 15px;
  color: #999;
  font-size: 14px;
}
</style>